package com.roamer.school.common.testredis;

import com.roamer.school.common.SchoolRedisTestApplication;
import com.roamer.school.common.conf.RedisService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SchoolRedisTestApplication.class)
@ActiveProfiles(profiles = {"redis"})
public class RedisTestUtils {

    @Autowired
    private RedisService redisService;

    @Test
    public void testRedisSetAndGet(){
       boolean flag = redisService.set("1234","sahdjsdfj12345");
       assertTrue(flag);
    }
}
